<template>
    <div class="noticeList-item-root">
        <div class="root-date" v-if="props.curData.isDate">
            {{ props.curData.createTime }}
        </div>
        <div class="root-content">

            <div class="title-left" :style="'height:' + (props.curData.isBottom ? '15px' : '100%') + ';'"></div>
            <div class="title-top"></div>
            <div class="title-bottom"></div>

            <div class="content-title">
                {{ props.curData.title }}
            </div>

            <div class="content-text" v-for="(item, index) in props.curData.text.split('\r')" :key="index">
                <div>{{ item }}</div>
                <div class="text-left"
                    :style="'height:' + (index == props.curData.text.split('\r').length - 1 ? '11px' : '100%') + ';'">
                </div>
                <div class="text-top"></div>
            </div>
        </div>

    </div>
</template>

<script setup>
const props = defineProps({
    curData: {},
    curIndex: 0,
})
const curColor = 'rgba(' + [0, 0, 0].fill(200 / 11 * (props.curIndex + 1)).toString() + ',1)';
</script>

<style lang="scss" scoped>
.noticeList-item-root {
    width: 98%;
    border-left: 2px solid v-bind(curColor);
    color: v-bind(curColor);

    .root-date {
        margin-left: 40px;
        align-items: center;
        height: 30px;
        font-size: 16px;
        color: rgba(128, 128, 128, 1);
        font-family: 900;
        line-height: 30px;
        position: relative;
    }

    .root-date:before {
        content: "";
        display: block;
        height: 2px;
        width: 30px;
        background: v-bind(curColor);
        position: absolute;
        left: -40px;
        top: 14px;
    }

    .root-date:after {
        content: "";
        display: block;
        height: 16px;
        width: 2px;
        background: v-bind(curColor);
        position: absolute;
        left: -25px;
        top: 14px;
    }


    .root-content {
        padding-left: 50px;
        width: 80%;
        word-wrap: break-word;
        position: relative;
        padding-bottom: 7px;

        .content-title {
            font-size: 20px;
            font-weight: 900;
        }

        .title-left {
            position: absolute;
            width: 2px;
            height: 100%;
            left: 15px;
            background: v-bind(curColor);
        }

        .title-top {
            width: 30px;
            height: 2px;
            background: v-bind(curColor);
            position: absolute;
            left: 15px;
            top: 13px;
        }

        .title-bottom {
            width: 2px;
            height: 15px;
            background: v-bind(curColor);
            position: absolute;
            left: 30px;
            top: 15px;
        }
    }

    .content-text {
        position: relative;

        >div:first-child {
            margin-left: 5px;
        }

        .text-left {
            position: absolute;
            width: 2px;
            left: -20px;
            top: 0px;
            background: v-bind(curColor);
        }

        .text-top {
            position: absolute;
            width: 20px;
            height: 2px;
            left: -20px;
            top: 9px;
            background: v-bind(curColor);
        }
    }


}
</style>